﻿<?php

class Application_Form_Foto extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
		$this->addDecorator('FormElements')
            -> setAttrib('enctype', 'multipart/form-data')
			->addDecorator('Form');

		$fileImage1 = new Zend_Form_Element_File('image1');
		$fileImage1
			->addDecorator('Label')
			->addDecorator('Description',array('escape'=>false,'tag'=>'div'))
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field'))
			->setAttribs(array('class'=>'gallery-photo1-input'))
			->setDescription('Recomendamos subir im&aacute;genes en formato <strong>.jpg</strong> de <strong>600 x 400</strong> pixeles.')
			->setLabel('Imagen:');			
			
		$textAreaDescription1 = new Zend_Form_Element_Textarea('description1');
		$textAreaDescription1
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->setAttribs(array('placeholder'=>'Escribe una descripción de la foto','class'=>'autogrow','rows'=>'1'))
			->setLabel('Descripción:');
		
		$this->addElements( array (
			$fileImage1,
			$textAreaDescription1
		));				
       
	   $this->addDisplayGroup(array(
				'image1',
                'description1'
        ),'photo1',array('legend'=>'Imagen Uno:'));
        $general = $this->getDisplayGroup('photo1');
        $general->setDecorators(array(
                'FormElements',
				'Fieldset'
        ));
		
		$fileImage2 = new Zend_Form_Element_File('image2');
		$fileImage2
			->addDecorator('Label')
			->addDecorator('Description',array('escape'=>false,'tag'=>'div'))
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field'))
			->setAttribs(array('class'=>'gallery-photo2-input'))
			->setDescription('Recomendamos subir im&aacute;genes en formato <strong>.jpg</strong> de <strong>600 x 400</strong> pixeles.')
			->setLabel('Imagen:');			
			
		$textAreaDescription2 = new Zend_Form_Element_Textarea('description2');
		$textAreaDescription2
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->setAttribs(array('placeholder'=>'Escribe una descripción de la foto','class'=>'autogrow','rows'=>'1'))
			->setLabel('Descripción:');
		
		$this->addElements( array (
			$fileImage2,
			$textAreaDescription2
		));				
       
	   $this->addDisplayGroup(array(
				'image2',
                'description2'
        ),'photo2',array('legend'=>'Imagen Dos:'));
        $general = $this->getDisplayGroup('photo2');
        $general->setDecorators(array(
                'FormElements',
				'Fieldset'
        ));

		$fileImage3 = new Zend_Form_Element_File('image3');
		$fileImage3
			->addDecorator('Label')
			->addDecorator('Description',array('escape'=>false,'tag'=>'div'))
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field'))
			->setAttribs(array('class'=>'gallery-photo3-input'))
			->setDescription('Recomendamos subir im&aacute;genes en formato <strong>.jpg</strong> de <strong>600 x 400</strong> pixeles.')
			->setLabel('Imagen:');			
			
		$textAreaDescription3 = new Zend_Form_Element_Textarea('description3');
		$textAreaDescription3
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->setAttribs(array('placeholder'=>'Escribe una descripción de la foto','class'=>'autogrow','rows'=>'1'))
			->setLabel('Descripción:');
		
		$this->addElements( array (
			$fileImage3,
			$textAreaDescription3
		));				
       
	   $this->addDisplayGroup(array(
				'image3',
                'description3'
        ),'photo3',array('legend'=>'Imagen Tres:'));
        $general = $this->getDisplayGroup('photo3');
        $general->setDecorators(array(
                'FormElements',
				'Fieldset'
        ));
		
		$fileImage4 = new Zend_Form_Element_File('image4');
		$fileImage4
			->addDecorator('Label')
			->addDecorator('Description',array('escape'=>false,'tag'=>'div'))
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field'))
			->setAttribs(array('class'=>'gallery-photo4-input'))
			->setDescription('Recomendamos subir im&aacute;genes en formato <strong>.jpg</strong> de <strong>600 x 400</strong> pixeles.')
			->setLabel('Imagen:');			
			
		$textAreaDescription4 = new Zend_Form_Element_Textarea('description4');
		$textAreaDescription4
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->setAttribs(array('placeholder'=>'Escribe una descripción de la foto','class'=>'autogrow','rows'=>'1'))
			->setLabel('Descripción:');
		
		$this->addElements( array (
			$fileImage4,
			$textAreaDescription4
		));				
       
	   $this->addDisplayGroup(array(
				'image4',
                'description4'
        ),'photo4',array('legend'=>'Imagen Cuatro:'));
        $general = $this->getDisplayGroup('photo4');
        $general->setDecorators(array(
                'FormElements',
				'Fieldset'
        ));
		
		$fileImage5 = new Zend_Form_Element_File('image5');
		$fileImage5
			->addDecorator('Label')
			->addDecorator('Description',array('escape'=>false,'tag'=>'div'))
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field'))
			->setAttribs(array('class'=>'gallery-photo5-input'))
			->setDescription('Recomendamos subir im&aacute;genes en formato <strong>.jpg</strong> de <strong>600 x 400</strong> pixeles.')
			->setLabel('Imagen:');			
			
		$textAreaDescription5 = new Zend_Form_Element_Textarea('description5');
		$textAreaDescription5
			->setDecorators(array('ViewHelper'))
			->addDecorator('Label')
			->addDecorator('HtmlTag',array('tag'=>'div','class'=>'field fullwidth'))
			->setAttribs(array('placeholder'=>'Escribe una descripción de la foto','class'=>'autogrow','rows'=>'1'))
			->setLabel('Descripción:');
		
		$this->addElements( array (
			$fileImage5,
			$textAreaDescription5
		));				
       
	   $this->addDisplayGroup(array(
				'image5',
                'description5'
        ),'photo5',array('legend'=>'Imagen Cinco:'));
        $general = $this->getDisplayGroup('photo5');
        $general->setDecorators(array(
                'FormElements',
				'Fieldset'
        ));												

        $submitForm = new Zend_Form_Element_Submit('submit');
		$submitForm
			->setDecorators(array('ViewHelper'))
			->addDecorator('Description',array('escape'=>false,'tag'=>'div','openOnly'=>true,'placement'=>'prepend'))
			->setAttribs(array('class'=>'bt blue'))
			->setDescription('<footer class="pane">')				
			->setLabel('Publicar');
			
        $resetForm = new Zend_Form_Element_Reset('reset');
		$resetForm
			->setDecorators(array('ViewHelper'))
			->addDecorator('Description',array('escape'=>false,'tag'=>'div','closeOnly'=>true))
			->setAttribs(array('class'=>'bt orange'))
			->setDescription('</footer>')				
			->setLabel('Limpiar');			
		
		$this->addElements( array (
			$submitForm,
			$resetForm
		));		
 
    }

}